package course.API;

public class Demo01Math {
    public static void main(String[] args) {
        int abs = Math.abs(-10);
        System.out.println(abs);

        //向上取整
        double ceil = Math.ceil(10.1);
        System.out.println(ceil);

        //向下取整
        double floor = Math.floor(10.9);
        System.out.println(floor);

        //四舍五入
        long round = Math.round(10.1);
        System.out.println(round);

        long round1 = Math.round(1.9);
        System.out.println(round1);

        int max = Math.max(10,20);
        System.out.println(max);

        int min = Math.min(10,20);
        System.out.println(min);

        //次方
        double pow = Math.pow(2,3);
        System.out.println(pow);
    }
}
